Skip to content

Add Mockito and convert the first jMock tests - #8395

Draft
labkey-adam wants to merge 1 commit into
developfrom
fb_manual_jmock_to_mockito
Draft

labkey-adam wants to merge 1 commit into
developfrom
fb_manual_jmock_to_mockito

Conversation

@labkey-adam

@labkey-adam labkey-adam commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Start replacing jMock, which is unmaintained and depends on cglib and an old Objenesis, with Mockito for server-side tests. These tests run inside the live server, so Mockito is configured to mock by subclassing and never to attach a Java agent to the server JVM. A follow-up converts the remaining jMock tests and removes jMock and cglib.

Related Pull Requests

Changes

  • Add Mockito to the api module, configured to create subclass mocks without a Java agent
  • Convert the Lsid and ReplacedRunFilter tests to Mockito, covering both interface and concrete-class mocks
  • ReplacedRunFilter's tests now verify that the expected calls happen, which the jMock version never checked

Testing

Ran Lsid, ReplacedRunFilter, FileUtil (still jMock, now on the newer Objenesis), and TotpManager (mfa) test cases on a local server: all pass. Confirmed via debugger that the mocks are Mockito subclass mocks and that the server log has no Java agent warnings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant